package com.ruoyi.project.module.products.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.web.domain.BaseEntity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 商品以及库存表 erp_Products
 * 
 * @author lcx
 * @date 2018-08-15
 */
public class Products extends BaseEntity
{
	private static final long serialVersionUID = 1L;
	
	/** 编号 */
	private String id;
	/** 创建人编号 */
	private String creatorId;
	/** 创建日期 */
	private Date createDate;
	/** 修改人编号 */
	private String updateId;
	/** 修改日期 */
	private Date updateDate;
	/** 公司id */
	private String companyId;
	/** 商品名称 */
	private String productName;
	/** 商品类别 */
	private String productClass;
	/** 商品类型 */
	private String productType;
	/** 主SKU */
	private String mainSKU;
	/** unionSKU */
	private String unionSKU;
	/** size */
	private String size;
	/** EAN */
	private String eAN;
	/** 图片地址 */
	private String picUrl;
	/** 采购数量 */
	private Integer purchaseQuantity;
	/** 确认数量 */
	private Integer submitQuantity;
	/** 售出数量 */
	private Integer soldQuantity;
	/** 退货数量 */
	private Integer refundQuantity;
	/** 退货入库量 */
	private Integer refundPutInQuantity;
	/** 退货损耗量 */
	private Integer refundLossQuantity;
	/** FBS转入 */
	private Integer fbsIntoQuantity;
	/** FBS退回入库量 */
	private Integer fbsRefundPutInQuantity;
	/** FBS退回损耗量 */
	private Integer fbsRefundLossQuantity;
	/** 国内仓损耗量 */
	private Integer chinaStorageLossQuantity;
	/** 海外仓损耗量 */
	private Integer overseasStorageLossQuantity;
	/** 盘点数量 */
	private Integer shareQuantity;
	/**  */
	private BigDecimal sharePrice;
	/**  */
	private String bz;

	/**  */
	private String field1;
	/**  */
	private String field2;
	/**  */
	private String field3;
	/* 盘点时间*/
	private Date takingDate;

	private int line_num; //批量插入时候的行号

	private Integer onhand;//库存数量

	private String onhandDb;//数据库查询出来的库存

    private String onhandString;//



	/*查询用的创建时间*/
	private String beginCreateDate;
	private  String endCreateDate;

    /*查询用的创建时间*/
    private String beginTakingDate;
    private  String endTakingDate;

	public int getLine_num() {
		return line_num;
	}

	public void setLine_num(int line_num) {
		this.line_num = line_num;
	}

	public String getOnhandDb() {
		return onhandDb;
	}

	public void setOnhandDb(String onhandDb) {
		this.onhandDb = onhandDb;
	}

	public String getOnhandString() {
        return onhandString;
    }

    public void setOnhandString(String onhandString) {
        this.onhandString = onhandString;
    }

    public String geteAN() {
        return eAN;
    }

    public void seteAN(String eAN) {
        this.eAN = eAN;
    }

    public String getBeginTakingDate() {
        return beginTakingDate;
    }

    public void setBeginTakingDate(String beginTakingDate) {
        this.beginTakingDate = beginTakingDate;
    }

    public String getEndTakingDate() {
        return endTakingDate;
    }

    public void setEndTakingDate(String endTakingDate) {
        this.endTakingDate = endTakingDate;
    }

    public String getBeginCreateDate() {
		return beginCreateDate;
	}

	public void setBeginCreateDate(String beginCreateDate) {
		this.beginCreateDate = beginCreateDate;
	}

	public String getEndCreateDate() {
		return endCreateDate;
	}

	public void setEndCreateDate(String endCreateDate) {
		this.endCreateDate = endCreateDate;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public String getEAN() {
		return eAN;
	}

	public void setEAN(String eAN) {
		this.eAN = eAN;
	}

	public Date getTakingDate() {
		return takingDate;
	}

	public void setTakingDate(Date takingDate) {
		this.takingDate = takingDate;
	}

	private String sadasdsa;


	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCreatorId() {
		return creatorId;
	}

	public void setCreatorId(String creatorId) {
		this.creatorId = creatorId;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getUpdateId() {
		return updateId;
	}

	public void setUpdateId(String updateId) {
		this.updateId = updateId;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public String getProductClass() {
		return productClass;
	}

	public void setProductClass(String productClass) {
		this.productClass = productClass;
	}

	public String getProductType() {
		return productType;
	}

	public void setProductType(String productType) {
		this.productType = productType;
	}

	public String getMainSKU() {
		return mainSKU;
	}

	public void setMainSKU(String mainSKU) {
		this.mainSKU = mainSKU;
	}

	public String getUnionSKU() {
		return unionSKU;
	}

	public void setUnionSKU(String unionSKU) {
		this.unionSKU = unionSKU;
	}

	public String getSize() {
		return size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public String getPicUrl() {
		return picUrl;
	}

	public void setPicUrl(String picUrl) {
		this.picUrl = picUrl;
	}

	public Integer getPurchaseQuantity() {
		return purchaseQuantity;
	}

	public void setPurchaseQuantity(Integer purchaseQuantity) {
		this.purchaseQuantity = purchaseQuantity;
	}

	public Integer getSubmitQuantity() {
		return submitQuantity;
	}

	public void setSubmitQuantity(Integer submitQuantity) {
		this.submitQuantity = submitQuantity;
	}

	public Integer getSoldQuantity() {
		return soldQuantity;
	}

	public void setSoldQuantity(Integer soldQuantity) {
		this.soldQuantity = soldQuantity;
	}

	public Integer getRefundQuantity() {
		return refundQuantity;
	}

	public void setRefundQuantity(Integer refundQuantity) {
		this.refundQuantity = refundQuantity;
	}

	public Integer getRefundPutInQuantity() {
		return refundPutInQuantity;
	}

	public void setRefundPutInQuantity(Integer refundPutInQuantity) {
		this.refundPutInQuantity = refundPutInQuantity;
	}

	public Integer getRefundLossQuantity() {
		return refundLossQuantity;
	}

	public void setRefundLossQuantity(Integer refundLossQuantity) {
		this.refundLossQuantity = refundLossQuantity;
	}

	public Integer getFbsIntoQuantity() {
		return fbsIntoQuantity;
	}

	public void setFbsIntoQuantity(Integer fbsIntoQuantity) {
		this.fbsIntoQuantity = fbsIntoQuantity;
	}

	public Integer getFbsRefundPutInQuantity() {
		return fbsRefundPutInQuantity;
	}

	public void setFbsRefundPutInQuantity(Integer fbsRefundPutInQuantity) {
		this.fbsRefundPutInQuantity = fbsRefundPutInQuantity;
	}

	public Integer getFbsRefundLossQuantity() {
		return fbsRefundLossQuantity;
	}

	public void setFbsRefundLossQuantity(Integer fbsRefundLossQuantity) {
		this.fbsRefundLossQuantity = fbsRefundLossQuantity;
	}

	public Integer getChinaStorageLossQuantity() {
		return chinaStorageLossQuantity;
	}

	public void setChinaStorageLossQuantity(Integer chinaStorageLossQuantity) {
		this.chinaStorageLossQuantity = chinaStorageLossQuantity;
	}

	public Integer getOverseasStorageLossQuantity() {
		return overseasStorageLossQuantity;
	}

	public void setOverseasStorageLossQuantity(Integer overseasStorageLossQuantity) {
		this.overseasStorageLossQuantity = overseasStorageLossQuantity;
	}

	public Integer getShareQuantity() {
		return shareQuantity;
	}

	public void setShareQuantity(Integer shareQuantity) {
		this.shareQuantity = shareQuantity;
	}

	public BigDecimal getSharePrice() {
		return sharePrice;
	}

	public void setSharePrice(BigDecimal sharePrice) {
		this.sharePrice = sharePrice;
	}

	public String getBz() {
		return bz;
	}

	public void setBz(String bz) {
		this.bz = bz;
	}

	public String getField1() {
		return field1;
	}

	public void setField1(String field1) {
		this.field1 = field1;
	}

	public String getField2() {
		return field2;
	}

	public void setField2(String field2) {
		this.field2 = field2;
	}

	public String getField3() {
		return field3;
	}

	public void setField3(String field3) {
		this.field3 = field3;
	}

	public String getSadasdsa() {
		return sadasdsa;
	}

	public void setSadasdsa(String sadasdsa) {
		this.sadasdsa = sadasdsa;
	}

	public Integer getOnhand() {
		submitQuantity=submitQuantity==null?0:submitQuantity;
		soldQuantity=soldQuantity==null?0:soldQuantity;
		refundPutInQuantity=refundPutInQuantity==null?0:refundPutInQuantity;
		fbsIntoQuantity=fbsIntoQuantity==null?0:fbsIntoQuantity;
		fbsRefundPutInQuantity=fbsRefundPutInQuantity==null?0:fbsRefundPutInQuantity;
		chinaStorageLossQuantity=chinaStorageLossQuantity==null?0:chinaStorageLossQuantity;
		overseasStorageLossQuantity=overseasStorageLossQuantity==null?0:overseasStorageLossQuantity;
		return  submitQuantity - soldQuantity + refundPutInQuantity - fbsIntoQuantity
				+ fbsRefundPutInQuantity - chinaStorageLossQuantity - overseasStorageLossQuantity;
	}

	public void setOnhand(Integer onhand) {
		this.onhand = submitQuantity - soldQuantity + refundPutInQuantity - fbsIntoQuantity
				+ fbsRefundPutInQuantity - chinaStorageLossQuantity - overseasStorageLossQuantity;
	}



	public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("creatorId", getCreatorId())
            .append("createDate", getCreateDate())
            .append("updateId", getUpdateId())
            .append("updateDate", getUpdateDate())
            .append("companyId", getCompanyId())
            .append("productName", getProductName())
            .append("productClass", getProductClass())
            .append("productType", getProductType())
            .append("mainSKU", getMainSKU())
            .append("unionSKU", getUnionSKU())
            .append("size", getSize())
            .append("eAN", getEAN())
            .append("picUrl", getPicUrl())
            .append("purchaseQuantity", getPurchaseQuantity())
            .append("submitQuantity", getSubmitQuantity())
            .append("soldQuantity", getSoldQuantity())
            .append("refundQuantity", getRefundQuantity())
            .append("refundPutInQuantity", getRefundPutInQuantity())
            .append("refundLossQuantity", getRefundLossQuantity())
            .append("fbsIntoQuantity", getFbsIntoQuantity())
            .append("fbsRefundPutInQuantity", getFbsRefundPutInQuantity())
            .append("fbsRefundLossQuantity", getFbsRefundLossQuantity())
            .append("chinaStorageLossQuantity", getChinaStorageLossQuantity())
            .append("overseasStorageLossQuantity", getOverseasStorageLossQuantity())
            .append("shareQuantity", getShareQuantity())
            .append("sharePrice", getSharePrice())
            .append("bz", getBz())
            .append("field1", getField1())
            .append("field2", getField2())
            .append("field3", getField3())
            .toString();
    }
}
